package com.codedancer.campus.client.api.admin;

import com.codedancer.campus.client.service.IAdminService;
import com.codedancer.campus.client.service.vo.admin.AdminVo;
import com.codedancer.campus.common.core.BaseApi;
import com.codedancer.campus.common.response.ApiResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/admin")
@CrossOrigin(methods = {RequestMethod.GET, RequestMethod.POST, RequestMethod.DELETE,
    RequestMethod.PUT}, maxAge = 3600)
@Api(value = "管理员Api", description = "管理员Api", tags = "管理员Api")
public class AdminApi extends BaseApi {

    @Autowired
    private IAdminService adminService;

    @GetMapping("/random-one")
    @ApiOperation("随机获取一名客服管理员")
    public ApiResponse<AdminVo> randomOne() {
        return success(adminService.randomOne());
    }
}
